agentmux_srv\backend\storage\filestore/mod.rs
1// Copyright 2025-2026, AgentMux Corp.
2// SPDX-License-Identifier: Apache-2.0
3
4//! FileStore: file storage with write-through cache + background flusher.
5//! Port of Go's pkg/filestore/blockstore.go, blockstore_cache.go, blockstore_dbops.go.
6//!
7//! - Separate SQLite DB from WaveStore (matching Go).
8//! - 64KB parts for efficient partial reads/writes.
9//! - Write-through cache with periodic flush (5s default).
10//! - Background flusher via `tokio::spawn` + `tokio::time::interval`.
11
12mod cache;
13mod core;
14mod ijson;
15mod offset_ops;
16mod types;
17#[cfg(test)]
18mod tests;
19
20#[allow(unused_imports)]
21pub use core::{FileStore, DEFAULT_FLUSH_SECS, MAX_CACHE_BYTES};
22pub use types::{FileMeta, FileOpts, WaveFile};